package org.fyv233.missingno_craft.item;

import net.minecraft.item.*;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.fyv233.missingno_craft.Missingno_craft;
import org.fyv233.missingno_craft.block.ModBlocks;

public class ModItemsGroups {

    public static final RegistryKey<ItemGroup> MISSINGNO_GROUP = register("missingno_group");

    public static RegistryKey<ItemGroup> register(String id){
        return RegistryKey.of(RegistryKeys.ITEM_GROUP, Identifier.of(Missingno_craft.MOD_ID, id));
    }

    public static void registerModItemGroups() {
        Registry.register(Registries.ITEM_GROUP, MISSINGNO_GROUP,
                ItemGroup.create(ItemGroup.Row.TOP, 7)
                        .displayName(Text.translatable("itemGroup.missingno_craft.missingno_group"))
                        .icon(() -> new ItemStack(ModBlocks.MISSINGNO_BLOCK))
                        .entries((displayContext, entries) -> {
                            entries.add(ModItems.MISSINGNO_INGOT);
                            entries.add(ModItems.MISSINGNO_NUGGET);
                            entries.add(ModBlocks.MISSINGNO_BLOCK);
                            entries.add(ModBlocks.MISSINGNO_ORE);
                            entries.add(ModItems.MISSINGNO_PROSPECTER);

                            entries.add(ModItems.MISSINGNO_PICKAXE);
                            entries.add(ModItems.MISSINGNO_AXE);
                            entries.add(ModItems.MISSINGNO_HOE);
                            entries.add(ModItems.MISSINGNO_SWORD);

                            entries.add(ModBlocks.MISSINGNO_FENCE);
                            entries.add(ModBlocks.MISSINGNO_FENCE_GATE);
                            entries.add(ModBlocks.MISSINGNO_SLABS);
                            entries.add(ModBlocks.MISSINGNO_STAIRS);
                            entries.add(ModBlocks.MISSINGNO_BUTTON);

                            entries.add(ModItems.MISSINGNO_HELMET);
                            entries.add(ModItems.MISSINGNO_CHESTPLATE);
                            entries.add(ModItems.MISSINGNO_BOOTS);
                            entries.add(ModItems.MISSINGNO_LEGGINGS);
                        }).build());
    }

}
